package com.hkd.product_service.api.fallback;

import com.hkd.common.api.ApiResponse;
import com.hkd.common.api.BaseFallBack;
import com.hkd.common.api.BaseFallbackFactory;
import com.hkd.product_service.api.ProductPicInfoService;
import com.hkd.product_service.api.SupplierInfoService;
import com.hkd.product_service.api.dto.InsertSupplierDTO;
import org.springframework.stereotype.Component;

/**
 * @author HKD
 * @date 2022/9/17 22:09
 */
@Component
public class SupplierInfoServiceImplFallback extends BaseFallbackFactory<SupplierInfoService> {

    @Override
    public SupplierInfoService create(Throwable throwable) {
        FeignFallback fallback =new FeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
    public class FeignFallback extends BaseFallBack implements SupplierInfoService {
        @Override
        public ApiResponse insertSupplier(String curUserId, InsertSupplierDTO param) {
            return defaultFallBack();
        }
    }

}
